<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 500px;
        }
        img{
            width: 500px;
            display: block;
            position: relative;
        }
        button{
            position: absolute;
            left: 10px;
            top: 10px;
        }
    </style>
</head>
<body>
    <div>
        <img src="../images/1.webp">
        <button>X</button>
    </div>

    <script>
        const btn = document.querySelector('button')
        const divv = document.querySelector('div')
        btn.addEventListener('click',function(){
            divv.style.display = 'none'
        })
    </script>
</body>
</html>